

<template>
  <Modal :mask-closable="false" v-model="create" :title="addtitle" width="800">
            <Row>
                <Col span="15">
                <Form ref="form" class="formList" :model="formItem" :rules="ruleValidate" label-position="top">
                    <Row :gutter="16">
                        <Col span="12">
                        <FormItem label="料号：">
                            <Input type="text" v-model="formItem.materielNo" :placeholder="`${$t('common.inputInfo')}`" :maxlength="32"></Input>
                        </FormItem>
                        </Col>
                        <Col span="12">
                        <FormItem label="品名：">
                            <Input type="text" v-model="formItem.goodsName" :placeholder="`${$t('common.inputInfo')}`" :maxlength="32"></Input>
                        </FormItem>
                        </Col>
                    </Row>
                    <row :gutter="16">
                        <Col span="12">
                        <FormItem label="规格：">
                            <Input type="text" v-model="formItem.specification" :placeholder="`${$t('common.inputInfo')}`"
                                :maxlength="32"></Input>
                        </FormItem>
                        </Col>
                        <Col span="12">
                        <FormItem label="品牌：">
                            <Input type="text" v-model="formItem.brand" :placeholder="`${$t('common.inputInfo')}`" :maxlength="32"></Input>
                        </FormItem>
                        </Col>
                    </row>
                    <Row :gutter="16">
                        <Col span="12">
                        <FormItem label="备件ABC类：">
                            <Select v-model="formItem.sparePartsAbc" filterable clearable :placeholder="`${$t('common.selectInfo')}`">
                                <Option v-for="(item) of sparePartsAbcList" :value="item.label" :key="item.label">
                                    {{item.value}}</Option>
                            </Select>
                        </FormItem>
                        </Col>
                        <Col span="12">
                        <FormItem label="备件VED类：">
                            <Select v-model="formItem.sparePartsVed" filterable clearable :placeholder="`${$t('common.selectInfo')}`">
                                <Option v-for="(item) of sparePartsVedList" :value="item.label" :key="item.label">
                                    {{item.value}}</Option>
                            </Select>
                        </FormItem>
                        </Col>
                    </Row>
                    <Row :gutter="16">
                        <Col span="12">
                        <FormItem label="物品分类：">
                            <Select v-model="formItem.goodsType" filterable clearable :placeholder="`${$t('common.selectInfo')}`">
                                <Option v-for="(item) of goodsType" :value="item.label" :key="item.label">{{ item.value
                                    }}</Option>
                            </Select>
                        </FormItem>
                        </Col>
                        <Col span="12">
                        <FormItem label="资产类型：">
                            <Select v-model="formItem.assetType" filterable clearable :placeholder="`${$t('common.selectInfo')}`">
                                <Option v-for="(item) of assetType" :value="item.label" :key="item.label">{{ item.value
                                    }}</Option>
                            </Select>
                        </FormItem>
                        </Col>
                    </Row>
                    <Row :gutter="16">
                        <Col span="12">
                        <FormItem label="管理方式：">
                            <Select v-model="formItem.manageType" filterable clearable :placeholder="`${$t('common.selectInfo')}`">
                                <Option v-for="(item) of manageType" :value="item.label" :key="item.label">{{ item.value
                                    }}</Option>
                            </Select>
                        </FormItem>
                        </Col>
                        <Col span="12">
                        <FormItem label="安全库存：">
                            <Input type="text" v-model="formItem.safeStock" :placeholder="`${$t('common.inputInfo')}`" :maxlength="32"></Input>
                        </FormItem>
                        </Col>
                    </Row>
                    <Row :gutter="16">
                        <Col span="12">
                        <FormItem label="标准寿命：">
                            <Input type="text" v-model="formItem.standardLife" :placeholder="`${$t('common.inputInfo')}`" :maxlength="32" />
                        </FormItem>
                        </Col>
                        <Col span="12">
                        <FormItem label="上传附件：">
                            <Upload ref="fileUpload" :show-upload-list="false" :before-upload="handleBeforeUpload"
                                type="drag" action="" style="width:120px">
                                <Button type="primary">{{$t('common.Upload')}}</Button>
                            </Upload>

                            <div class="file-list" v-for="(item, index) in setFileList" :key="index">
                                <span class="item-src">{{ item.fileName }}</span>
                                <Icon class="item-icon" type="ios-trash-outline" size="20" @click="delFileList(index)"
                                    v-if="item"></Icon>
                            </div>
                        </FormItem>
                        </Col>
                    </Row>
                </Form>
                <div class="equipmentContent">
                    <span>关联设备</span>
                    <Icon type="md-add" size='16' />
                </div>
                <div>
                    <div class="tableContent">
                        <Table ellipsis ref="selection" stripe :columns="equipmentColumns" :data="equipmentDataArr"
                            height="500">
                            <!-- <template slot-scope="{ row ,index}" slot="action">
                    <span class="operationBtn" @click="delShow(row)"
                        v-if="checkBtnPermission.storeHouseDelete">{{$t('common.Delete')}}</span>
                </template> -->
                        </Table>
                    </div>
                </div>
                <div slot="footer">
                    <Button type="default" @click="create = false">{{$t('common.Cancle')}}</Button>
                    <Button type="primary" :loading="loading" @click="addOk('form')">{{$t('maintenance.Confirmed')}}</Button>
                </div>
                </Col>
                <Col span="9">col-12</Col>
            </Row>
        </Modal>
</template>

<script>
import {searchApi} from "@/api/spareParts/material.js";
export default {
name: "addMaterialModal",
data() {
    return{}
},
    props: {
            addtitle: {
                type: String,
                default: ""
            },
            formItem: {
                type: Array,
                default: () => []
            }
        },
          methods: {}
}

</script>

<style>

</style>
